<?php
require 'nette/Nette/loader.php';
Debug::enable();
require 'db.php';
require 'localization/lang.php';
require 'core/core.sanitizer.php';
require 'core/core.usermanagement.php';
require 'core/core.dfs.php';
require 'visual/visual.dfs.php';
require 'core/core.security.php';

if (isset($_POST['log_in'])) {
$login_instance=new core_security;
$login_instance->username=$_POST['username'];
$login_instance->passwd=$_POST['passwd'];

echo $login_instance->checkuser_data_validate();
echo $login_instance->checkuser_validate();
$login_instance->setlogin();

if ($login_instance->checklogin() == "OK") {
	echo "login successfull <br>";
	echo $_SESSION['logged']."<br>";
	echo $_SESSION['login']."<br>";
	echo $_SESSION['uid']."<br>";	
	$login_instance->unsetlogin();
	}

}

?>
<form action="index.php" method="POST">
<input type="text" name="username" value="">
<input type="text" name="passwd" value="">
<input type="submit" name="log_in" value="login">
</form>
<?php
	



?>
